package com.jdb.loan.api.service.boot.config;

import com.jdb.loan.api.service.FavoriteService;
import feign.Feign;
import feign.jackson.JacksonDecoder;
import feign.jackson.JacksonEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServiceConfig {
    @Bean
    public FavoriteService favoriteService() {
        return Feign.builder()
                .encoder(new JacksonEncoder())
                .decoder(new JacksonDecoder())
                .target(FavoriteService.class, "http://localhost:9009");
    }

}
